FlexGrid for WPF | ComponentOne
C1.WPF.FlexGrid.4.6.2 Assembly / C1.WPF.FlexGrid Namespace / RowColCollection<T> Class / Frozen Property
Example

In This Topic
    Frozen Property (RowColCollection<T>)
    In This Topic
    Gets or sets the number of frozen rows or columns in the collection.
    Syntax
    'Declaration
     
    Public Property Frozen As Integer
    public int Frozen {get; set;}
    Example
    The code below implements an event handler that toggles row and column freezing based on the cursor position (similar to the 'freeze panes' command in Excel).
    // handle the Click event on the _chkFreeze CheckBox to
    // freeze/unfreeze rows/columns
    void _chkFreeze_Click(object sender, RoutedEventArgs e)
    {
      if (_chkFreeze.IsChecked.Value)
      {
        // freeze rows and columns above and to the left of the cursor
        _flex.Rows.Frozen = _flex.Selection.Row;
        _flex.Columns.Frozen = _flex.Selection.Column;
      }
      else
      {
        // unfreeze rows and columns
        _flex.Rows.Frozen = 0;
        _flex.Columns.Frozen = 0;
      }
    }
    See Also